import { type App } from 'vue'
import { createWebHashHistory, createRouter } from 'vue-router'
import routes  from './routes'
import guard from './guard'
import autoload from './autoload'

const router = createRouter({
  history: createWebHashHistory(),
  routes:[...routes],
})

export function setupRouter(app:App){
    autoload(router)
    guard(router)
    app.use(router)
}

export default router